package java8;

import java.util.Arrays;

/**
 * @Author Yi Jun jie
 * @Time 2021/4/17 16:56
 */
public class ReduceDemo2 {
    public static void main(String[] args) {

        Integer[] arr = {23,43,45,12,21,23};

        Integer reduce = Arrays.stream(arr).parallel().reduce(0, (e1, e2) -> e1 + e2);
        System.out.println(reduce);

    }
}
